package com.wzw.shoppingcart.mapstruct;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wzw.shoppingcart.entity.Product;
import com.wzw.shoppingcart.vo.PageVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

/**
 *@author wzw
 * 2023/4/14
 */
@Mapper
public interface PageMapper {
    PageMapper INSTANCE = Mappers.getMapper(PageMapper.class);

    @Mapping(target = "productList", ignore = true)
    PageVo pageToPageVo(Page<Product> page);
}
